package com.wjm.blog.system.auth;

import com.wjm.blog.common.base.response.Result;
import com.wjm.blog.system.service.IAuthService;
import com.wjm.blog.system.vo.request.SysUserQueryVo;
import io.swagger.annotations.*;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author BUG WRITTER
 * @date 2023/10/18 14:42
 */
@Log4j2
@Api(tags = "权限管理")
@RestController
@RequestMapping("/api/v1.0")
public class AuthController {

    @Autowired
    private IAuthService authService;

    @ApiOperation(value = "用户登录接口", notes = "用户登录接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userAccount", value = "userAccount", dataType = "String"),
            @ApiImplicitParam(name = "userPwd", value = "userPwd", dataType = "String")
    })
    @ApiResponses(
            @ApiResponse(code = 200, message = "处理成功")
    )
    @PostMapping("/auth/login")
    Result login(@RequestBody SysUserQueryVo userQueryVo) throws Exception {
        return authService.login(userQueryVo);
    }

}
